<template>
    <div class="page">
        <el-pagination
        background
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="pagination.current_page"
        :page-sizes="pagination.page_sizes"
        :page-size="pagination.limit"
        layout="total, sizes, prev, pager, next, jumper"
        :total="pagination.total">
        </el-pagination>
    </div> 
</template>
<script>
export default {
    props:{
        /*
        pagination:{
        current_page: 1,
        page_sizes: [10, 20, 30, 40],
        limit: 10,
        total: 0
        }
        */
       pagination:Object,
       required:true
    },

    data() {
        return {
            
        }
    },

    methods:{
        //选择每页显示多少条
        handleSizeChange(val){
            this.pagination.limit = val;         
            this.$emit('getTable',this.pagination);          
            //this.$parent.$parent.$parent.geTableList(this.pagination);             
        },
        handleCurrentChange(val) {
            this.pagination.current_page = val;
            this.$emit('getTable',this.pagination);
        },

    },
}
</script>
<style>
   .page{
        float:right;
        margin-top: 10px;
    } 
</style>